import { defineComponent as T, ref as u, resolveComponent as _, openBlock as V, createElementBlock as b, createElementVNode as m, createVNode as p, mergeProps as f } from "vue";
const y = { class: "container" }, z = { style: { "margin-right": "20px" } }, C = /* @__PURE__ */ T({
  __name: "index",
  props: {
    startPlaceholder: { default: "开始日期" },
    endPlaceholder: { default: "结束日期" },
    size: { default: "default" },
    endDateTodaay: { type: Boolean, default: !0 }
  },
  emits: ["startTimeHandle", "endTimeHandle"],
  setup(a, { emit: d }) {
    const o = a;
    let n = d;
    const l = u(null), s = u(null), r = u(!0), h = (e) => {
      if (o.endDateTodaay)
        return e.getTime() < Date.now() - 1e3 * 60 * 60 * 24;
    }, v = (e) => {
      var t;
      if (l.value)
        return e.getTime() < ((t = l.value) == null ? void 0 : t.getTime()) + 1e3 * 60 * 60 * 24;
    }, D = (e) => {
      console.log("开始时间", e), e ? r.value = !1 : (r.value = !0, s.value = null, n("endTimeHandle", e)), n("startTimeHandle", e);
    }, g = (e) => {
      n("endTimeHandle", e);
    };
    return (e, t) => {
      const c = _("el-date-picker");
      return V(), b("div", y, [
        m("div", z, [
          p(c, f({
            modelValue: l.value,
            "onUpdate:modelValue": t[0] || (t[0] = (i) => l.value = i),
            type: "date",
            placeholder: e.startPlaceholder,
            size: e.size,
            disabledDate: h,
            onChange: D
          }, e.$attrs.startOptions), null, 16, ["modelValue", "placeholder", "size"])
        ]),
        m("div", null, [
          p(c, f({
            modelValue: s.value,
            "onUpdate:modelValue": t[1] || (t[1] = (i) => s.value = i),
            type: "date",
            placeholder: e.endPlaceholder,
            size: e.size,
            disabled: r.value,
            onChange: g,
            disabledDate: v
          }, e.$attrs.endOptions), null, 16, ["modelValue", "placeholder", "size", "disabled"])
        ])
      ]);
    };
  }
}), k = (a, d) => {
  const o = a.__vccOpts || a;
  for (const [n, l] of d)
    o[n] = l;
  return o;
}, H = /* @__PURE__ */ k(C, [["__scopeId", "data-v-31439f54"]]), E = {
  install(a) {
    a.component("m-chooseDate", H);
  }
};
export {
  E as default
};
